export const calcTagArticleCountAggregate = (tags: string[]) => {
  return [
    // 展开tags
    {
      $unwind: '$tags',
    },
    {
      $match: {
        tags: { $in: tags },
      },
    },
    {
      $group: {
        _id: '$tags',
        count: { $sum: 1 },
      },
    },
    {
      $project: {
        tag: '$_id',
        count: 1,
        _id: 0,
      },
    },
  ];
};
